//
//  NSString+Message.m
//  SymptomChecker
//
//  Created by 高天翔 on 15/7/9.
//
//

#import "NSString+Message.h"

@implementation NSString (Message)
- (NSString*)getImagePathByObjectID{
    return [NSTemporaryDirectory() stringByAppendingFormat:@"%@.jpg", self];
}

- (NSString*)getAudioPathByObjectID{
//    return [NIPathForDocumentsResource(@"audio_cache") stringByAppendingPathComponent:self];
    return @"aaaaa";
}

+ (NSString*)getConversionIDByFromID:(NSString*)fromID toID:(NSString*)toID{
    NSString* userid = fromID;
    NSString* toPeerID = toID;
    double userNum = [userid doubleValue];
    double peerNum = [toPeerID doubleValue];
    NSString* convID = nil;
    if (userNum < peerNum) {
        convID = [NSString stringWithFormat:@"%@:%@", userid, toPeerID];
    }else {
        convID = [NSString stringWithFormat:@"%@:%@", toPeerID, userid];
    }
    //    NSString* convID = [NSString stringWithFormat:@"%@:%@", userid, toPeerID];
    //    NSLog(@"%@", [@"881646:879113" md5Hash]);
    return convID ;
}



@end
